package mock.action;


import com.opensymphony.xwork2.ActionSupport;

public class ProcessAction extends ActionSupport{

	private String txtProcess;
	private String btnAction;
	
	public String getBtnAction() {  
		return btnAction;
	}

	public void setBtnAction(String btnAction) {
		this.btnAction = btnAction;
	}

	public String getTxtProcess() {
		return txtProcess;
	}

	public void setTxtProcess(String txtProcess) {
		this.txtProcess = txtProcess;
	}

	/**
	 * noi xu li hau nhu tat ca cac request! Hay goi anh ay la superman
	 */
	@Override
	public String execute() throws Exception {
		if(btnAction.equals("Enter")){
			if(txtProcess.equals("validatePIN")) return "authenticateAction";
			if(txtProcess.equals("checkBalance")) return "printReceiptAction";
			if(txtProcess.equals("chooseAmount")) return "withdrawAction";
			if(txtProcess.equals("enterAmountPage")) return "withdrawAction";
			if(txtProcess.equals("withdraw")) return "printReceiptAction";
			if(txtProcess.equals("ruleCashTransfer")) return "transferInfocashTransferAction";
			if(txtProcess.equals("receiverInformationPage")) return "enterAmountCashTransferPage";
			if(txtProcess.equals("enterAmountCashTransfer")) return "checkAmountcashTransferAction";
			if(txtProcess.equals("cashTransferInformation")) return "processcashTransferAction";
			if(txtProcess.equals("enterReceiverID")) return "receiverInfocashTransferAction";
			if(txtProcess.equals("enterNewPIN")) return "checkPINchangePINAction";
			if(txtProcess.equals("reEnterNewPIN")) return "processchangePINAction";
			if(txtProcess.equals("filterCriteria"));
			if(txtProcess.equals("viewHistory")) return "printReceiptPage";
			if(txtProcess.equals("chooseAmount"));
		}
		if(btnAction.equals("Cancel")){
			if(txtProcess.equals("checkBalance")) return "mainScreen";
			if(txtProcess.equals("chooseAmount")) return "mainScreen";
			if(txtProcess.equals("enterAmountPage")) return "mainScreen";
			if(txtProcess.equals("ruleCashTransfer")) return "mainScreen";
			if(txtProcess.equals("receiverInformationPage")) return "enterReceiveIDPage";
			if(txtProcess.equals("enterAmountCashTransfer")) return "mainScreen";
			if(txtProcess.equals("cashTransferInformation")) return "enterAmountCashTransferPage";
			if(txtProcess.equals("enterReceiverID")) return "mainScreen";
			if(txtProcess.equals("withdraw")) return "mainScreen";
			if(txtProcess.equals("enterNewPIN")) return "mainScreen";
			if(txtProcess.equals("reEnterNewPIN")) return "mainScreen";
			if(txtProcess.equals("filterCriteria")) return "mainScreen";
			if(txtProcess.equals("viewHistory")) return "mainScreen";
		}
		if(btnAction.equals("button5")){
			if(txtProcess.equals("validatePIN")) return "authenticateAction";
			if(txtProcess.equals("checkBalance")) return "printReceiptAction";
			if(txtProcess.equals("chooseAmount")) return "withdrawAction";
			if(txtProcess.equals("enterAmountPage")) return "withdrawAction";
			if(txtProcess.equals("withdraw")) return "printReceiptAction";
			if(txtProcess.equals("ruleCashTransfer")) return "transferInfocashTransferAction";
			if(txtProcess.equals("receiverInformationPage")) return "enterAmountCashTransferPage";
			if(txtProcess.equals("cashTransferInformation")) return "processcashTransferAction";
			if(txtProcess.equals("mainScreen")) return "enterNewPINPage";
			if(txtProcess.equals("filterCriteria")) return "loadPageviewHistoryAction";
		}
		if(btnAction.equals("button6")){
			if(txtProcess.equals("checkBalance")) return "mainScreen";
			if(txtProcess.equals("chooseAmount")) return "enterAmountPage";
			if(txtProcess.equals("enterAmountPage")) return "mainScreen";
			if(txtProcess.equals("ruleCashTransfer")) return "mainScreen";
			if(txtProcess.equals("receiverInformationPage")) return "enterReceiveIDPage";
			if(txtProcess.equals("cashTransferInformation")) return "enterAmountCashTransferPage";
			if(txtProcess.equals("withdraw")) return "mainScreen";
			if(txtProcess.equals("filterCriteria")) return "loadPageviewHistoryAction";
			if(txtProcess.equals("viewHistory")) return "changePageviewHistoryAction";
			if(txtProcess.equals("mainScreen")) return "finalAction";
		}
		if(btnAction.equals("button2")){
			if(txtProcess.equals("mainScreen")) return "checkBalanceAction";
			if(txtProcess.equals("chooseAmount")) return "withdrawAction";
			if(txtProcess.equals("filterCriteria")) return "loadPageviewHistoryAction";
		}
		if(btnAction.equals("button1")){
			if(txtProcess.equals("mainScreen")) return "chooseAmountPage";
			if(txtProcess.equals("chooseAmount")) return "withdrawAction";
			if(txtProcess.equals("filterCriteria")) return "loadPageviewHistoryAction";
		}
		if(btnAction.equals("button3")){
			if(txtProcess.equals("chooseAmount")) return "withdrawAction";
			if(txtProcess.equals("mainScreen")) return "cashTransferPage";
			if(txtProcess.equals("filterCriteria")) return "loadPageviewHistoryAction";
			if(txtProcess.equals("viewHistory")) return "changePageviewHistoryAction";
		}
		if(btnAction.equals("button4")){
			if(txtProcess.equals("chooseAmount")) return "withdrawAction";
			if(txtProcess.equals("mainScreen")) return "filterCriteriaPage";
			if(txtProcess.equals("filterCriteria")) return "loadPageviewHistoryAction";
		}
		return "indexPage";
	}
	
	

}
